package org.restql.webapp;

public class RestQLException extends Exception {

	private static final long serialVersionUID = 1L;
	private String message = null;
	private boolean accessDenied = false;

	public RestQLException(String message, Exception e) {
		super(e);
		this.message = message;
		if (e.getMessage().contains("Access denied")) {
			this.accessDenied = true;
		}
	}

	public RestQLException(String message) {
		super(message);
		this.message = message;
	}

	public RestQLException(String message, Exception e, boolean authProblem) {
		super(e);
		this.accessDenied = authProblem;
	}

	public String toString() {
		return this.message;
	}

	public boolean getAccessDenied() {
		return this.accessDenied;
	}

}
